1. Field of the Invention
Apparatuses and methods consistent with the present invention relate to converting the visual appearance of a Java application program in real time, and more particularly, to a method and an apparatus for converting a visual appearance of the Java application program in real time that allows an interface-based Java application program to convert a color combination, font, icon, text position, and external appearance of a component in real time by adding a new interface that defines the visual appearance of the Java application program to a Java application programming interface (API).
2. Description of the Related Art
Java is an object oriented programming language that is platform independent. Here, the platform refers to hardware environment in which a program is executed or a software environment such as an operating system. Java code is compiled to Java byte code by a Java compiler, and the Java byte code is executed by a Java virtual machine (which has been ported to a variety of platforms).
FIG. 1 illustrates a conventional system in which a Java application program can operate.
The system comprises a Java application program 11, a Java application programming interface (API) 12, a Java virtual machine 13 and a hardware-based platform 14.
The Java application program 11 refers to a program written in the Java language, which is compiled into Java byte code using a Java compiler, and the Java byte code is interpreted by the Java virtual machine and then executed. At this time, the Java virtual machine 13 operates as an interpreter with respect to the Java byte codes.
The Java API 12 as aggregated libraries or classes for developing a Java program; they are provided in packaged units where interrelated classes are bundled.
The Java application program 11 uses the Java API 12 in order to provide a graphic user interface (hereinafter, referred to as a “GUI”), wherein the Java API 12 outputs a graphic on a screen by using a GUI of the platform 14.
The Java API 12 used for providing a GUI is classified into a heavy-weight API and a light-weight API, according to drawing modes. The heavy-weight API is platform-dependent because it writes a GUI in the format supplied by a platform-based GUI. The light-weight API can provide a GUI in the same format in other platforms as it writes the GUI in the format desired by the developer and transmits it to the platform-based GUI.
Here, the Java Abstract Window Toolkit is the heavy-weight API, and the Java Swing is the light-weight API.
FIG. 2 illustrates a construction of a class to draw a component through the conventional Java Abstract Window Toolkit.
The Label component 22 is an extension of a Component class 21 of the Abstract Window Toolkit, which is connected to a LabelPeer class 23 for connection with a platform-based GUI 24. The LabelPeer class 23 plays a role in connecting the platform-based GUI 24 and the Label component 22. Owing to this construction, the Abstract Window Toolkit provides a platform dependent GUI.
FIG. 3 illustrates a construction of a class to draw a component through the conventional Java Swing.
The Label component of Swing is JLabel, and a JLabel component 33 is an extension of the JComponent class 32. The JComponent class 32 finally inherits the Component class 31. The JLabel component 33 has an object 34 called a LabelUI, which draws the JLabel component 33, and which is not connected with a platform-based GUI. The portions that draw a component are all realized in Java, and they are output on a screen through the Java virtual machine 35.
Accordingly, Swing components are output on a screen having the same look, regardless of platforms.
The visual appearance is a visual property of a component output on a screen; it indicates a color combination, a font and an icon of a component, and the location and external appearance of text.
As mentioned above, the external appearance of the component changes according to the platform and real-time conversion is not impossible because the Abstract Window Toolkit is platform-dependent.
However, with Swing the external appearance of the component does not change according to a platform because Swing is platform-independent. However, applying Swing to a program written based on the Abstract Window Toolkit may produce problems.
The visual appearance of a component is only applicable in the application program unit due to a structural limitation of the light-weight API, and it can not be applied to all the application programs in operation on a platform.